#include "hbhandle.h"

HandleHeartBeat::HandleHeartBeat() {}
HandleHeartBeat *HandleHeartBeat::getInstance() {
    static HandleHeartBeat obj;
    return &obj;
}
void HandleHeartBeat::run(ChatService *ptr) {
    _workThread = std::move(std::thread([&]() {
        while (true) {
            sleep(1);
            ptr->increaseBeat();
        }
    }));
    _workThread.detach();
}